package com.authine.cloudpivot.ext.utils.finance;

import com.authine.cloudpivot.ext.constants.AppConst;
import com.authine.cloudpivot.ext.constants.ServiceUrlConst;
import com.authine.cloudpivot.ext.dto.finance.AccountDto;
import com.authine.cloudpivot.ext.utils.HttpClients;
import com.google.common.collect.Maps;
import org.springframework.util.Assert;

import java.util.Map;

/**
 * 结算账户工具类
 */
public class AccountUtils {

    public static AccountDto getAccountById(String id){
        Assert.notNull(id,"查询账户ID不能为空");
        String url = HttpClients.getUrl(AppConst.FINANCIALCENTER, ServiceUrlConst.GET_ACCOUNT_URL);
        Map<String, Object> param = Maps.newHashMap();
        param.put("id", id);
        return HttpClients.execute(url, param, AccountDto.class);
    }

}
